/**
* @Title: warningAnalysis_ctrl.js
* @Description: TODO
* Copyright: Copyright (c) 2014 
 * Company:中国平安
*
* @Project HIMS-FWA
* @author EX-XIEQI001
* @date 2014年10月13日 下午2:03:33
* @version V1.0
*/
;
(function(){
	'use strict';
	
	var app = angular.module('fwa.mainApp');
	app.controller('WarningAnalysisCtrl', ['$scope','$http','$state','BaseURL','Modal',
	                                function($scope,$http,$state,baseUrl,Modal){
		$scope.visitTypeDatas = [
			                    {name:"门诊",code:"1"},
			                    {name:"住院",code:"2"}
			                    ];
		
		$scope.columns = [
							{label:'序号',map:'',width:'7%',cellTemplate:'<span ng-bind="$index + 1"></span>'},
							{label:'医疗机构名称',map:'orgName',width:'16%'},
							{label:'医疗费用总额',map:'ze',width:'16%'},
							{label:'医保费用总额',map:'ybze',width:'16%'},
							{label:'统筹基金总额',map:'jjze',width:'16%'},
							{label:'就诊人数',map:'rs',width:'13%'},
							{label:'人均统筹基金',map:'pj',width:'16%'}
						];
		
		//查询
		$scope.onSubmit = function(){
			query();
		}
		var query =	function(){
			$http({
				method : 'GET',
				cache : false,
				url : baseUrl + 'mock/achievements/warning/getPoolingFundsData.json',
				params : {
					start : 1,
					limit : 20
				}
			}).success(function(response, status, headers, config) {
				$scope.tableData = response.root;
				$scope.totalCount = response.total;
			});
		}
		$scope.onSubmit();
		
		//分页监听
		$scope.$on('pageTool.skipPage',function(e,v){
			$scope.currentPage =v;
			query();
		});
	}]);
})();